-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Add a command to apply a JSLT transformation to an ORT result #3831
Merged
sschuberth
merged 2 commits into
oss-review-toolkit:master
from
boschglobal:oheger-bosch/scanner/transform_result_storage
Apr 9, 2021
Merged
Proposal: Add a command to apply a JSLT transformation to an ORT result #3831
sschuberth
merged 2 commits into
oss-review-toolkit:master
from
boschglobal:oheger-bosch/scanner/transform_result_storage
Apr 9, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oheger-bosch
force-pushed
the
oheger-bosch/scanner/transform_result_storage
branch
from
March 31, 2021 11:01
539a683
to
253a45e
Compare
I like the idea! |
mnonnenmacher
previously requested changes
Apr 1, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea as well, just found two nit-picks.
oheger-bosch
force-pushed
the
oheger-bosch/scanner/transform_result_storage
branch
from
April 6, 2021 05:46
253a45e
to
65adf1e
Compare
@oheger-bosch can you please
|
oheger-bosch
force-pushed
the
oheger-bosch/scanner/transform_result_storage
branch
from
April 8, 2021 06:07
65adf1e
to
93e2ca3
Compare
JSLT [1] supports powerful transformations on JSON data. This command is useful for instance if there are breaking changes in ORT's data format; by applying a corresponding transformation, stored results can be upgraded to the new format. [1] https://github.com/schibsted/jslt Signed-off-by: Oliver Heger <[email protected]>
Align the helper commands to the convention used by the standard commands where it makes sense. Signed-off-by: Oliver Heger <[email protected]>
oheger-bosch
force-pushed
the
oheger-bosch/scanner/transform_result_storage
branch
from
April 8, 2021 07:01
93e2ca3
to
7ea374c
Compare
The -i alias has been added to most of the helper commands; at least to those that support a unique input file (which is not necessarily always an ORT result). |
fviernau
reviewed
Apr 8, 2021
sschuberth
approved these changes
Apr 8, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JSLT [1] supports powerful transformations on JSON data. Possible use cases would be the conversion of existing results to conform to breaking changes in ORT's data model or the manipulation of results to generate test data. I played around with JSLT when I changed the data format for vulnerabilities in the Advisor module. As I found it useful, I thought I could share it. If you think, this is out of scope, just close this PR.
There is one limitation, however: JSLT does not handle tags in YAML and simply drops them. This is a problem with ORT result files because Jackson uses such tags to deal with class hierarchies. Currently the configuration of scan result storages makes use of this mechanism; so a manual post-processing of result files is necessary.
As an example for a JSLT transformation that could be applied, here is one that converts the advisor result section from the old format of vulnerabilities to the new one (as introduced in #3823):
[1] https://github.com/schibsted/jslt